import requests

session = requests.Session()


cookie_url = 'https://cn.baozimhcn.com/user/signin'

cookie_response = session.get(cookie_url)
print(session.cookies)



login_url = 'https://cn.baozimhcn.com/api/bui/signin'


json = {
    'username':'wert123@123.com',
    'password':'wert123',
}

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36',
    'Referer': 'https://cn.baozimhcn.com/user/signin',
    'Content-Type':'application/json',
    'Accept': 'application/json, text/plain, */*',
    'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
    'Accept-Encoding': 'gzip, deflate, br',
    'Origin': 'https://cn.baozimhcn.com',
    'Sec-Fetch-Dest': 'empty',
    'Sec-Fetch-Mode': 'cors',
    'Sec-Fetch-Site': 'same-origin',
}

login_response = session.post(login_url, json=json, headers=headers)
print(login_response)
print(login_response.cookies)


url = 'https://cn.baozimhcn.com/user/my_bookshelf'
headers.update({'Referer':'https://cn.baozimhcn.com/user/signin'})
book_response = session.get(url, headers=headers)
print(book_response.text)

